# -*- coding: utf-8 -*-
dns_str=None
databaselogging=None
socketlogging=None
utf8mutex=None
urt8ring=None

DatabaseConnPool = None
DatabaseConnPool_Mutex = None

SPLITCHAR='`'
ENDCHAR='\x0a'
TABCHAR='\t'
COMMANDID_LENGTH=4
COMMANDTYPE_LENGTH=4
DEVICEID_LENGTH=6
DATETIME_LENGTH=14
TASKID_LENGTH=20
COMMAND_LOGIN='1000'
COMMAND_1000='1000'


COMMAND_DOWNLOAD_RECEIVE_BILL='1001'
COMMAND_1001='1001'

COMMAND_NEW_RECEVIE_BILL='1002'
COMMAND_1002='1002'

COMMAND_UPDATE_SIGNIN_BILL='1003'
COMMAND_1003='1003'

COMMAND_1004 = '1004'
COMMAND_CANCEL_BILL='1005'
COMMAND_1005 = '1005'

COMMAND_QUERY_XML='1006'
COMMAND_1006='1006'

COMMAND_UPLOAD_RECEVIE_BILL='1007'
COMMAND_1007='1007'

COMMAND_REQUEST_NOTICE='1008'
COMMAND_1008='1008'

COMMAND_1009='1009'
COMMAND_1010='1010'
COMMAND_1011='1011'
COMMAND_1012='1012'


COMMAND_2000 ='2000'
COMMAND_QUERY_DEVICE_STATUS = '2000'

STATUS_OK='00'
STATUS_ERROR_UNKOWN='FF'
STATUS_ERROR_INVALID_ID='FF'
STATUS_ERROR_TIMEOUT='FE'
STATUS_ERROR_SOCKET='FD'
STATUS_ERROR_LOGIN_PASSWORD_DISMATCH='FC'
STATUS_ERROR_LOGIN_NO_USER='FB' 
STATUS_ERROR_NO_BILL_CODE='E0'
CONTENT_SPLIT='\t'     
SEND_END_CHAR='\n'

TAB_PROBLEM_COLUMN = "TYPE,BILL_CODE,SEND_SITE,REGISTER_SITE,REGISTER_DATE,REGISTER_MAN ,PROBLEM_CAUSE,REVERSION,REVERSION_MAN,REVERSION_DATE,PROVIDE_SITE ,REGISTER_SAVE_DATE,REGISTER_MAN_DEPARTMENT "

TAB_GPRS_SIGN_QY_COLUMN = "BILL_CODE, SIGN_MAN, RECORD_SITE, RECORD_MAN, RECORD_MAN_CODE, SIGN_DATE, REMARK"
 
TAB_GPRS_SCAN_QY_COLUMN = "   ID           , BILL_CODE            , SUB_BILL_CODE        , TRANSFERE_BILL_CODE  , OWNER_BAG_NO, \
                SCAN_TYPE    , PRE_OR_NEXT_STATION  , SCAN_MAN             , SCAN_SITE            , SCAN_DATE,\
        DISPATCH_OR_SEND_MAN , CUSTOMER_NAME        , GOODS_TYPE           , CLASS                , REMARK,\
         INSERT_COMPUTER_ID  , SCAN_MAN_CODE        , LOGIN_USER           , LOGIN_USER_CODE      , LOGIN_USER_NAME,\
        GOODS_WEIGHT         , GOODS_FEE            , SIGNIN_NAME          , BL_RETURN_WRITE_ID   , CUSTOMER_PHONE1,\
         CUSTOMER_PHONE2, BL_MESSAGE,CUSTOMER_CODE,PAYMENT_TYPE,TRAN_COSTS,CASH_ON_DELIVERY,INSURED_AMOUNT,SERIAL_NUMBER,SURE_NUMBER"
TAB_GPRS_MSG_COLUMN = "GUID, SUBJECT, OWNER_SITE, EMPLOYEE_CODE, EMPLOYEE_NAME, MSG_STATE, CREATE_DATE, MSG_CONTENT, ATTEMPER_MAN, BILL_CODE, RESTORE, RESTORE_DATE"

TAB_SEND_QINYI_COLUMN="SEID,SCAN_NAME,SCAN_CODE,SCAN_DATE,SITE_NAME,\
 SITE_CODE ,PACKBAG_CODE ,CLASS_CODE ,NEXTWORK_CODE ,BILL_CODE , \
 SEND_DATE"      
TAB_ARRIVE_QINYI_COLUMN = "\
    ARID,UPWORK_CODE,UPLOAD_DATE, ARRIVE_DATE,MEMBER_CODE,MEMBER_NAME\
    SITE_CODE,BILL_CODE"
    
    
TAB_GPRS_DISPATCH_QINYI_COLUMN="DIID,EMPLOYEE_CODE,EMPLOYEE_NAME,DISPATCH_DATE，\
   UPLOAD_DATE,BILL_CODE，SCAN_EMPNAME,SCAN_EMPCODE,\
   SCAN_SITECODE "
TAB_GPRS_LEAVE_QINYI_COLUMN="LEID,BILL_CODE,LEAVE_DATE,UPLOAD_DATE,\
MEMBER_CODE,MEMBER_NAME,SITE_CODE"